package com.sojson.project.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sojson.project.dao.WorkExperienceDao;
import com.sojson.project.entity.po.WorkExperience;
import com.sojson.project.service.WorkExperienceService;

/**
 * 工作经历表Service实现类
 * 
 * @author liu
 * @date 2021-04-26
 */
@Service
public class WorkExperienceServiceImpl implements WorkExperienceService {

    @Resource
    private WorkExperienceDao workExperienceDaoImpl;

    /**
     * 单条插入
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int insert(WorkExperience workExperience) {
        int insert = workExperienceDaoImpl.insert(workExperience);
        return insert;
    }

    /**
     * 批量插入
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int insertList(WorkExperience workExperience) {
        int insertList = workExperienceDaoImpl.insertList(workExperience.getWorkExperiences());
        return insertList;
    }

    /**
     * 通过对象批量删除(物理删除)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int deleteByDto(WorkExperience workExperience) {
        int deleteByDto = workExperienceDaoImpl.deleteByDto(workExperience);
        return deleteByDto;
    }

    /**
     * 统计全部数量
     * 
     * @return
     */
    @Override
    public int countAll() {
        int countAll = workExperienceDaoImpl.countAll();
        return countAll;
    }

    /**
     * 查询所有
     * 
     * @return
     */
    @Override
    public List<WorkExperience> findAll() {
        List<WorkExperience> findAll = workExperienceDaoImpl.listAll();
        return findAll;
    }

    /**
     * 根据对象统计数量
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int countByDto(WorkExperience workExperience) {
        int countByDto = workExperienceDaoImpl.countByDto(workExperience);
        return countByDto;
    }

    /**
     * 根据对象查询
     * 
     * @param workExperience
     * @return
     */
    @Override
    public List<WorkExperience> findByDto(WorkExperience workExperience) {
        List<WorkExperience> findByDto = workExperienceDaoImpl.listByDto(workExperience);
        return findByDto;
    }

    /**
     * 通过id删除(物理删除)
     * 
     * @param id
     * @return
     */
    @Override
    public int deleteById(Integer id) {
        int deleteById = workExperienceDaoImpl.deleteById(id);
        return deleteById;
    }

    /**
     * 通过id列表删除(物理删除)
     * 
     * @param ids
     * @return
     */
    @Override
    public int deleteByIdList(List<Integer> ids) {
        int deleteByIdList = workExperienceDaoImpl.deleteByIdList(ids);
        return deleteByIdList;
    }

    /**
     * 通过id更新(全部更新)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updateById(WorkExperience workExperience) {
        int updateById = workExperienceDaoImpl.updateById(workExperience);
        return updateById;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容相同)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updateStaticByIdList(WorkExperience workExperience) {
        int updateStaticByIdList = workExperienceDaoImpl.updateStaticByIdList(workExperience);
        return updateStaticByIdList;
    }

    /**
     * 通过id列表更新(全部更新)(更新内容不相同)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updateChangeByIdList(WorkExperience workExperience) {
        int updateChangeByIdList = workExperienceDaoImpl.updateChangeByIdList(workExperience.getWorkExperiences());
        return updateChangeByIdList;
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updatePartialById(WorkExperience workExperience) {
        int updatePartialById = workExperienceDaoImpl.updatePartialById(workExperience);
        return updatePartialById;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容相同)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updateStaticPartialByIdList(WorkExperience workExperience) {
        int updateStaticPartialByIdList = workExperienceDaoImpl.updateStaticPartialByIdList(workExperience);
        return updateStaticPartialByIdList;
    }

    /**
     * 通过id列表更新(局部更新)(更新内容不相同)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updateChangePartialByIdList(WorkExperience workExperience) {
        int updateChangePartialByIdList = workExperienceDaoImpl.updateChangePartialByIdList(workExperience.getWorkExperiences());
        return updateChangePartialByIdList;
    }

    /**
     * 通过id查询
     * 
     * @param id
     * @return
     */
    @Override
    public WorkExperience findById(Integer id) {
        WorkExperience findById = workExperienceDaoImpl.findById(id);
        return findById;
    }

    /**
     * 通过id列表查询
     * 
     * @param ids
     * @return
     */
    @Override
    public List<WorkExperience> findByIdList(List<Integer> ids) {
        List<WorkExperience> findByIdList = workExperienceDaoImpl.findByIdList(ids);
        return findByIdList;
    }

    /**
     * 通过对象查询id列表
     * 
     * @param workExperience
     * @return
     */
    @Override
    public List<Integer> findIdByDto(WorkExperience workExperience) {
        List<Integer> findIdByDto = workExperienceDaoImpl.findIdByDto(workExperience);
        return findIdByDto;
    }

    /**
     * 通过userId删除(物理删除)
     * 
     * @param userId
     * @return
     */
    @Override
    public int deleteByUserId(Integer userId) {
        int deleteByUserId = workExperienceDaoImpl.deleteByUserId(userId);
        return deleteByUserId;
    }

    /**
     * 通过userId列表删除(物理删除)
     * 
     * @param userIds
     * @return
     */
    @Override
    public int deleteByUserIdList(List<Integer> userIds) {
        int deleteByUserIdList = workExperienceDaoImpl.deleteByUserIdList(userIds);
        return deleteByUserIdList;
    }

    /**
     * 通过userId更新(全部更新)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updateByUserId(WorkExperience workExperience) {
        int updateByUserId = workExperienceDaoImpl.updateByUserId(workExperience);
        return updateByUserId;
    }

    /**
     * 通过userId列表更新(全部更新)(更新内容相同)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updateStaticByUserIdList(WorkExperience workExperience) {
        int updateStaticByUserIdList = workExperienceDaoImpl.updateStaticByUserIdList(workExperience);
        return updateStaticByUserIdList;
    }

    /**
     * 通过userId列表更新(全部更新)(更新内容不相同)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updateChangeByUserIdList(WorkExperience workExperience) {
        int updateChangeByUserIdList = workExperienceDaoImpl.updateChangeByUserIdList(workExperience.getWorkExperiences());
        return updateChangeByUserIdList;
    }

    /**
     * 通过userId更新(局部更新)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updatePartialByUserId(WorkExperience workExperience) {
        int updatePartialByUserId = workExperienceDaoImpl.updatePartialByUserId(workExperience);
        return updatePartialByUserId;
    }

    /**
     * 通过userId列表更新(局部更新)(更新内容相同)
     * 
     * @param workExperience
     * @return
     */
    @Override
    public int updateStaticPartialByUserIdList(WorkExperience workExperience) {
        int updateStaticPartialByUserIdList = workExperienceDaoImpl.updateStaticPartialByUserIdList(workExperience);
        return updateStaticPartialByUserIdList;
    }

    /**
     * 通过userId列表更新(局部更新)(更新内容不相同)
     * 
     * @param workExperiences
     * @return
     */
    @Override
    public int updateChangePartialByUserIdList(WorkExperience workExperience) {
        int updateChangePartialByUserIdList = workExperienceDaoImpl.updateChangePartialByUserIdList(workExperience.getWorkExperiences());
        return updateChangePartialByUserIdList;
    }

    /**
     * 通过userId查询
     * 
     * @param userId
     * @return
     */
    @Override
    public WorkExperience findByUserId(Integer userId) {
        WorkExperience findByUserId = workExperienceDaoImpl.findByUserId(userId);
        return findByUserId;
    }

    /**
     * 通过userId列表查询
     * 
     * @param userIds
     * @return
     */
    @Override
    public List<WorkExperience> findByUserIdList(List<Integer> userIds) {
        List<WorkExperience> findByUserIdList = workExperienceDaoImpl.findByUserIdList(userIds);
        return findByUserIdList;
    }

    /**
     * 通过对象查询userId列表
     * 
     * @param workExperience
     * @return
     */
    @Override
    public List<Integer> findUserIdByDto(WorkExperience workExperience) {
        List<Integer> findUserIdByDto = workExperienceDaoImpl.findUserIdByDto(workExperience);
        return findUserIdByDto;
    }

    /**
     * 清空数据(物理清空)
     */
    @Override
    public void clear() {
        workExperienceDaoImpl.clear();
    }

}